Skip to content

feat(chronicle): Add Terraform support for Chronicle Parser#17774

Open
govisingh-dotcom wants to merge 2 commits into
GoogleCloudPlatform:mainfrom
govisingh-dotcom:chronicle-parser-only-govisingh
Open

feat(chronicle): Add Terraform support for Chronicle Parser#17774
govisingh-dotcom wants to merge 2 commits into
GoogleCloudPlatform:mainfrom
govisingh-dotcom:chronicle-parser-only-govisingh

Conversation

@govisingh-dotcom
Copy link
Copy Markdown

@govisingh-dotcom govisingh-dotcom commented Jun 1, 2026

This PR adds the google_chronicle_parser resource in GA.
It includes:

  • Basic and Full configurations for the Chronicle Parser resource.
  • Handwritten acceptance tests verifying full CRUD capabilities (including recreation on immutable fields and multi-step updates).
  • Native State Preservation: Utilizes ignore_read: true to handle the API's write-only validated_on_empty_logs (internal name skip_validation_on_no_logs) field, cleanly avoiding perpetual diffs and import mismatches.
  chronicle: Added `google_chronicle_parser` resource

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Jun 1, 2026
@github-actions github-actions Bot requested a review from melinath June 1, 2026 09:00
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 1, 2026

Googlers: For automatic test runs see go/terraform-auto-test-runs.

@melinath, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@modular-magician modular-magician added service/chronicle and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Jun 1, 2026
@modular-magician
Copy link
Copy Markdown
Collaborator

modular-magician commented Jun 1, 2026

Hi there, I'm the Modular magician. I've detected the following information about your changes for commit 7161a46:

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 4 files changed, 2383 insertions(+)
google-beta provider View Diff 4 files changed, 2383 insertions(+)
terraform-google-conversion View Diff 1 file changed, 533 insertions(+)

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_chronicle_parser (3 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_chronicle_parser" "primary" {
  changelogs {
    entries {
      change_message = # value needed
      create_time    = # value needed
      deleted        = # value needed
      parser_version = # value needed
    }
  }
  low_code {
    field_extractors {
      append_repeated_fields = # value needed
      extractors {
        value = # value needed
      }
      preprocess_config {
        grok_regex = # value needed
        target     = # value needed
      }
    }
  }
  version_info {
    auto_upgrade_disabled = # value needed
  }
}

Test report

Analytics

Total Tests Passed Skipped Affected
42 39 1 2
Affected Service Packages
  • chronicle

Learn how VCR tests work


Step 1: Replaying Mode

Action taken

Found 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit.

Click here to see the affected tests
  • TestAccChronicleParser_chronicleParserBasicExample
  • TestAccChronicleParser_chronicleParserFullExample_update

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
✅ Log TestAccChronicleParser_chronicleParserBasicExample
✅ Log TestAccChronicleParser_chronicleParserFullExample_update

🟢 All tests passed!

View the recording VCR build log or the debug logs folder for detailed results.

@govisingh-dotcom, @melinath, @ankitgoyal0301 VCR tests complete for 7161a46!

Copy link
Copy Markdown
Member

@melinath melinath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please ensure that all fields are tested - see missing test report

you may also want to use samples instead of examples for tests because it allows handling update tests as well as basic tests: https://googlecloudplatform.github.io/magic-modules/reference/sample/ Migration guide: https://googlecloudplatform.github.io/magic-modules/reference/update-test-changes/

@govisingh-dotcom govisingh-dotcom force-pushed the chronicle-parser-only-govisingh branch from 7161a46 to b714269 Compare June 2, 2026 16:13
@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Jun 2, 2026
@github-actions github-actions Bot requested a review from melinath June 2, 2026 16:14
@govisingh-dotcom
Copy link
Copy Markdown
Author

Please ensure that all fields are tested - see missing test report

you may also want to use samples instead of examples for tests because it allows handling update tests as well as basic tests: https://googlecloudplatform.github.io/magic-modules/reference/sample/ Migration guide: https://googlecloudplatform.github.io/magic-modules/reference/update-test-changes/

I have successfully migrated the test suite to the modern samples framework, expanded the configurations to cover all writeable fields reported in the missing test report, and removed the custom handwritten test file. All acceptance tests compile and pass cleanly locally.

@modular-magician modular-magician removed the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Jun 2, 2026
@modular-magician
Copy link
Copy Markdown
Collaborator

modular-magician commented Jun 2, 2026

Hi there, I'm the Modular magician. I've detected the following information about your changes for commit b714269:

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 4 files changed, 2286 insertions(+)
google-beta provider View Diff 4 files changed, 2286 insertions(+)
terraform-google-conversion View Diff 1 file changed, 443 insertions(+)

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_chronicle_parser (2 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_chronicle_parser" "primary" {
  changelogs {
    entries {
      change_message = # value needed
      create_time    = # value needed
      deleted        = # value needed
      parser_version = # value needed
    }
  }
}

Test report

Analytics

Total Tests Passed Skipped Affected
42 40 1 1
Affected Service Packages
  • chronicle

Learn how VCR tests work


Step 1: Replaying Mode

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit.

Click here to see the affected tests
  • TestAccChronicleParser_chronicleParserFullExample

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
✅ Log TestAccChronicleParser_chronicleParserFullExample

🟢 All tests passed!

View the recording VCR build log or the debug logs folder for detailed results.

@govisingh-dotcom, @melinath, @ankitgoyal0301 VCR tests complete for b714269!

This PR adds the google_chronicle_parser resource in GA.
It includes basic and full configurations auto-generated under the modern samples framework, and a custom flattener to handle the write-only validated_on_empty_logs field.

TAG=agy
CONV=7ff89b1b-2de9-433d-a2c7-25158b871127
@govisingh-dotcom govisingh-dotcom force-pushed the chronicle-parser-only-govisingh branch from b714269 to 95169e2 Compare June 3, 2026 06:00
@modular-magician modular-magician added awaiting-approval Pull requests that need reviewer's approval to run presubmit tests and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Jun 3, 2026
@modular-magician
Copy link
Copy Markdown
Collaborator

modular-magician commented Jun 3, 2026

Hi there, I'm the Modular magician. I've detected the following information about your changes for commit 95169e2:

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 4 files changed, 2286 insertions(+)
google-beta provider View Diff 4 files changed, 2286 insertions(+)
terraform-google-conversion View Diff 1 file changed, 443 insertions(+)

Test report

Analytics

Total Tests Passed Skipped Affected
43 42 1 0
Affected Service Packages
  • chronicle

Learn how VCR tests work


Step 1: Replaying Mode

🟢 All tests passed in Replaying mode! No Recording was needed.

View the replaying VCR build log

@govisingh-dotcom, @melinath, @ankitgoyal0301 VCR tests complete for 95169e2!

- projects/{{project}}/locations/{{location}}/instances/{{instance}}/logTypes/{{logtype}}/parsers/{{parser}}
autogen_status: UGFyc2Vy
autogen_async: false
samples:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add update tests?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually most of the writeable fields for google_chronicle_parser (such as cbn, low_code, and validated_on_empty_logs) are immutable (ForceNew: true), meaning any changes to them force the resource to be recreated. Because of this, we split the configurations into separate basic and full single-step tests to verify these fields.

The only mutable field that supports in-place updates is version_info.auto_upgrade_disabled. I will add a multi-step update test that toggles auto_upgrade_disabled."

@@ -0,0 +1,14 @@
func flatten{{$.GetPrefix}}{{$.TitlelizeProperty}}(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add a comment on the purpose of this file for better readabillity?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure added. Thanks

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Jun 4, 2026
@modular-magician modular-magician removed the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Jun 4, 2026
@modular-magician
Copy link
Copy Markdown
Collaborator

modular-magician commented Jun 4, 2026

Hi there, I'm the Modular magician. I've detected the following information about your changes for commit 6257764:

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 4 files changed, 2381 insertions(+)
google-beta provider View Diff 4 files changed, 2381 insertions(+)
terraform-google-conversion View Diff 1 file changed, 443 insertions(+)

Test report

Analytics

Total Tests Passed Skipped Affected
45 43 1 1
Affected Service Packages
  • chronicle

Learn how VCR tests work


Step 1: Replaying Mode

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit.

Click here to see the affected tests
  • TestAccChronicleParser_chronicleParserUpdateExample

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
❌ Error · Log - TestAccChronicleParser_chronicleParserUpdateExample

Caution

Issues requiring attention before PR completion

🔴 Initial Recording Failed: Some tests failed during the recording step. See the table above for details.

Please address these issues to complete your PR. If you believe these detections are incorrect or unrelated to your change, please raise the concern with your reviewer.

View the recording VCR build log or the debug logs folder for detailed results.

@govisingh-dotcom, @melinath, @ankitgoyal0301 VCR tests complete for 6257764!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants